#pragma once
#include "Bios.h"
#include "SHFEMarketHandler.h"
#include "SHFETraderHandler.h"

class SHFEConnection : public BIOS
{
public:
	SHFEConnection(User const& user, ContractCodeSet const& contractSet, VectorRegister& vectorRegister, string const& traderUrl, string const& marketUrl);
	virtual void Init();
	virtual void Release();
	virtual void Login(User const& user);
	virtual void SendOrderInsert(Dealing const& dealing);
	virtual void SendOrderAction(OrderAction const& action);
	virtual void SubscribeMarket(char const* contractCode);
	virtual void QueryMblMarket(char const* contractCode);

private:
	void InitTraderApi();
	void InitMdApi();

private:
	ContractCodeSet const& m_contractSet;
	string m_traderUrl;
	string m_marketUrl;
};